<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./libs/vue2.js"></script>
</head>
<body>
    <div id="app">
        <!-- 
            v-for指令的优先级高于v-if( v-for指令先执行, v-if指令后执行 )
         -->
        <h3 v-for="(item,index) in list" v-if="index<=2" :key="item">{{item}}</h3>
    </div>
</body>
<script>
    new Vue({
        el:'#app',
        data:{
            list:['苹果','香蕉','草莓','榴莲','水密桃']
        }
    });
</script>
</html>